#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from tortoise import Model, fields


class User(Model):
    """
    用户类
    """

    id = fields.BigIntField(pk=True, index=True, description='主键id')
    mobile = fields.CharField(max_length=32, unique=True, description='手机号码')
    username = fields.CharField(max_length=32, description='用户名')
    type = fields.SmallIntField(max_length=2, description='用户类型：3为平台，4为供应商，5为人才 0为非后台默认0')
    password = fields.CharField(max_length=255, description='密码')
    email = fields.CharField(max_length=64, unique=True, description='邮箱')
    status = fields.SmallIntField(default=1, description='是否激活')
    is_admin = fields.BooleanField(default=False, description='是否是超级管理员 0不是 1是')
    shop_code = fields.CharField(max_length=256, null=True, description='店铺token')
    reg_time = fields.DatetimeField(auto_now_add=True, description='注册时间')

    class Meta:
        table = 'xkyx_ucenter_member'
